package com.wwdx.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.wwdx.model.dto.MerchantInfoDTO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author liguoliang
 */
@Table(name = "wwdx_weixin_user")
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@JsonIgnoreProperties({"id","appid","unionId","sex","city","country","province","language",
"subscribeTime","gmtCreated","gmtModified"})
public class WwdxWeixinUserModel implements Serializable{

    @Id
    @GeneratedValue
    private Long id;
    @Column(name = "openid",unique = true)
    private String openId;
    private String appid;
    @Column(name = "unionid")
    private String unionId;
    private String nickname;
    private Integer sex;
    @Column(name = "headimgurl")
    private String headImgUrl;
    private String city;
    private String country;
    private String province;
    private String language;
    private Boolean subscribe;
    private String signature;
    @Column(name = "subscribe_time")
    private Long subscribeTime;
    @Column(name = "gmt_created",updatable = false)
    private Date gmtCreated;
    @Column(name = "gmt_modified")
    private Date gmtModified;

    @Transient
    private WwdxVipUserModel vip;
    @Transient
    private String token;
    @Transient
    private String authorizerAppid;
    /**
     * 商户信息
     */
    @Transient
    private MerchantInfoDTO model;
}